Writing Posts in Vignette
Vignette is built around a simple workflow: configure your site and personas once in TypeScript, then focus on writing Markdown or MDX files under posts/. This guide covers how the theme is structured, how to fill out frontmatter, and a few important details to keep in mind as you publish.
Setting Up the Theme
Before writing your first post, review the two main configuration files in src/settings/:
src/settings/site.settings.ts— Sets the site title, description, canonicalurl,defaultLocale,timezone, and optional features such as Giscus comments, analytics, and PWA offline caching.src/settings/personas.settings.ts— Defines your editorial personas insidePERSONAS, including each persona’s avatar, optional social links, and localized descriptions.
PERSONAS must contain at least one entry. Every personas value used in a post’s frontmatter must match a key defined in PERSONAS.
Where Posts Live
Place .md or .mdx files anywhere inside posts/, typically grouped by language folder:
posts/
├── en/
│ └── my-first-post.md
└── ko/
└── my-first-post.md
The filename (without extension) becomes the post’s URL slug. If two posts in different languages share the same filename—for example posts/en/my-first-post.md and posts/ko/my-first-post.md—Vignette automatically links them together so readers can switch languages from the corner of the frame.
Frontmatter Reference
Each post starts with a YAML frontmatter block validated at build time against the schema in src/content.config.ts:
---
title: My First Post
description: A brief summary shown on cards and in SEO metadata.
personas: [About the theme]
date: 2026-11-28 18:00:00 +0900
last_modified_at: 2026-11-28 18:00:00 +0900
lang: en
toc: true
math: false
mermaid: false
draft: false
---
Required Fields
title— Post heading and<title>metadata.date— Publication timestamp (e.g.2026-11-28 18:00:00 +0900). If you omit the timezone offset, Vignette falls back toSITE.timezone.lang— A valid BCP 47 language code (en,ko,ja,zh-CN,zh-TW,es,fr, etc.). Posts indefaultLocaleare served at the root, while other locales are automatically prefixed (such as/ko/...).
Optional Fields
description— Short summary used on post cards, RSS feeds, and meta tags.last_modified_at— Updated timestamp shown in the post colophon.personas— A persona ID or array of IDs fromPERSONAS(e.g.[About the theme]). Defaults to the first persona inPERSONASif omitted.toc— Set totrueto display the sticky Table of Contents on desktop.math— Set totrueto enable KaTeX math rendering for$...$and$$...$$.mermaid— Set totrueto load Mermaid for```mermaiddiagram blocks.draft— Set totrueto exclude the post from production builds.og_image/image— Custom social preview or header image. Paths must be absolute frompublic/(starting with/) or fullhttps://URLs.redirect_from— Array of legacy paths that should redirect to this post.
Writing & Formatting Caveats
A few deliberate behaviors in Vignette differ from generic Markdown setups:
- Use absolute paths for local images — Place assets in
public/assets/...and reference them as/assets/...(not./assets/...). This ensures images resolve consistently across nested locale/persona routes and subpath deployments. - Math is opt-in per post — Unless
math: trueis set in frontmatter,$...$and$$...$$remain literal text so dollar amounts like$10are never accidentally parsed as equations. - Strikethrough requires double tildes — Single-tilde strikethrough is disabled so numeric ranges like
1~2stay intact. Always use~~strikethrough~~. - Captions and image modifiers — Place an italicized line immediately below an image (
*Caption text*) to render a caption, and attach class attributes such as{: .left },{: .right },{: .border }, or{: .img-light }/{: .img-dark }for theme-aware illustrations. - Callouts and embeds — Use container directives (
:::info,:::tip,:::warning,:::danger) for callouts, and:::youtubeor::video/::audiofor media.
Checking and Building
Before publishing, run the type and schema check alongside the production build:
npm run check
npm run build
npm run check validates frontmatter fields, persona IDs, and locale codes, while npm run build checks for route conflicts, compiles static HTML to dist/, and generates the Pagefind search index.